package com.mc.array;

import java.util.Arrays;

public class MaxMin {
	public static void maxMin(int[] a){
		Arrays.sort(a);
		int i=0;
		int j=a.length-1;
		int maxPair = 1;
		int p1 = 1;
		int p2 = 1;
		while(a[j-1]==a[j]){
			p1++;
			j--;
		}
		while(a[i+1]==a[i]){
			p2++;
			i++;
		}
		maxPair = p1*p2;
		int min = Integer.MAX_VALUE;
		int minPair = 0;
		for(int k=1;k<a.length;k++){
			if(a[k]-a[k-1]<min){
				min = a[k]-a[k-1];
				minPair=1;
			}
			else if(a[k]-a[k-1]==min)
				minPair++;
		}
		System.out.println(maxPair+":"+minPair);
		
	}
	public static void main(String[] args) {
		MaxMin.maxMin(new int[]{26788});
	}
}
